import request from '@/utils/request';

export async function pageTask(projectId, params,cancelAble) {
    return request(`/project/${projectId}/task/page`, {
        params,
    });
}

export async function save(projectId, data) {
    return request(`/project/${projectId}/task`, {
        method: "POST",
        data: data
    });
}

export async function update(projectId, taskId, data) {
    return request(`/project/${projectId}/task/${taskId}`, {
        method: "POST",
        data: data
    });
}

export async function getDetail(projectId, taskId) {
    return request(`/project/${projectId}/task/${taskId}`);
}

export async function deleteTask(projectId, taskId) {
    return request(`/project/${projectId}/task/${taskId}`, {
        method: "DELETE",
    });
}

export async function updateIsArchived(projectId, taskId, isArchived) {
    return request(`/project/${projectId}/task/${taskId}/${isArchived}`, {
        method: "POST",
    });
}